import { defineStore } from 'pinia'

export const dataCacheStore = defineStore('notification', {
  state: () => ({
    searchKey: '',
    jobType: '', // 搜索关键词存储
    currentPlayData: {} // 视频的当前播放数据存储
  }),
  getters: {
    // 获取对应的state的值
    getSearchKey: (state) => state.searchKey,
    getJobType: (state) => state.jobType
  },
  actions: {
    setSearchKey(data) {
      this.searchKey = data
    },
    setJobType(data) {
      this.jobType = data
    },
    persist: {
      enabled: true,
      encryptionKey: 'data-catch'
    }
  }
})
